﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LibFriesland_Campina_CRM;

public partial class ViewNaSale : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["account"] == null)
            Response.Redirect("login.aspx");
        if (!IsPostBack)
        {
            databindNA();
        }
    }

    #region Lien ket du lieu
    private void databindNA()
    {
        List<BizNA> nas = BizNA.getAll();
        cboNA.DataSource = nas;
        cboNA.DataValueField = "na_charid";
        cboNA.DataTextField = "name";
        cboNA.DataBind();

        dtFromDate.Date = DateTime.Now.Date;
        dtToDate.Date = DateTime.Now.Date;

        ListItem item = new ListItem("--", "");
        cboNA.Items.Add(item);
        cboNA.SelectedIndex = cboNA.Items.Count - 1;

    }
    #endregion
}